import { request } from "@/utils/service"

export interface IScenicArea {
  id?: number
  scenicName: string
  scenicProvince: string
  scenicCity: string
}

export interface ICreateScenicAreaDataApi {
  scenicName: string
  scenicProvince: string
  scenicCity: string
}

export interface IGetScenicAreaListDataApi {
  scenicName: string
  scenicProvince: string
  /** 当前页码 */
  pageNum: number
  /** 查询条数 */
  pageSize: number
}

export interface IProvince {
  id: number
  name: string
}

export function createScenicArea(data: ICreateScenicAreaDataApi) {
  return request({
    url: "/travel/manage/scenic/create",
    method: "post",
    data
  })
}

export function updateScenicArea(id: number, data: ICreateScenicAreaDataApi) {
  return request({
    url: "/travel/manage/scenic/update/" + id,
    method: "put",
    data
  })
}

export function getScenicAreaList(params: IGetScenicAreaListDataApi) {
  return request({
    url: "/travel/manage/scenic/list",
    method: "get",
    params
  })
}

export function getScenicAreaAll() {
  return request({
    url: "/travel/manage/scenic/all",
    method: "get"
  })
}

export function deleteScenicArea(id: number) {
  return request({
    url: "/travel/manage/scenic/delete/" + id,
    method: "delete"
  })
}

export function getProinceList() {
  return request({
    url: "/travel/manage/scenic/province/all",
    method: "get"
  })
}

export function getAreaList() {
  return request({
    url: "/travel/manage/scenic/area/all",
    method: "get"
  })
}
